package com.bzsg.rightsManagementSystem.dao

import org.apache.ibatis.annotations.Delete
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper

@Mapper
interface UserRoleRelationDao {
    @Insert(
        "  insert into user_role_relation(user_id, role_id)\n" +
                "        values (#{userId}, #{roleId})"
    )
    fun addUserRoleRelation(userId: Int, roleId: Int)

    @Delete(
        "   delete\n" +
                "        from user_role_relation\n" +
                "        where user_id = #{userId}"
    )
    fun deleteAllUserRoleRelationByUserId(userId: Int)
}